//
//  Address.m
//  EJLX
//
//  Created by adc on 15/11/27.
//  Copyright © 2015年 江苏一键联信息科技有限公司. All rights reserved.
//

#import "Address.h"

@implementation Address

+(Address *)praseWithDictionary:(NSDictionary *)dict{
    Address *add = [[Address alloc] init];
    if (![dict[@"name"] isKindOfClass:[NSNull class]]) {
         add.name = dict[@"name"];
    }else{
         add.name = @"";
    }
    
    if (![dict[@"address"] isKindOfClass:[NSNull class]]) {
        add.address = dict[@"address"];
    }else{
        add.address = @"";
    }
    if (![dict[@"phone"] isKindOfClass:[NSNull class]]) {
        add.phone = dict[@"phone"];
    }else{
        add.phone = @"";
    }
    
  //  add.isDefault = [dict[@"defaultAdd"] intValue];
    if (dict[@"id"]) {
        add.addressID = [dict[@"id"] intValue];
    }else{
        add.addressID = 0;
    }
    
  
    return add;
}



@end
